<div class="post">
  <p class="post_title"><%= @media.category.image=="" ? link_to(@media.category.name, url_for(:controller=>"media",:action=>"category",:id=>@media.category.name)) : link_to(image_tag(@media.category.image,:border =>0), url_for(:controller=>"media",:action=>"category",:id=>@media.category.name)) %> <%= link_to HTMLEntities.decode_entities(@media.title), url_for(:controller=>@media.permalink) %></p>
  <p class="post_details"><%= @media.creation.strftime("%d/%m/%Y %H:%M") %>&nbsp;<%= theme_image_tag "user.png",:border=>0 %><%= @media.user.login %>&nbsp;<%= theme_image_tag "folder.png",:border=>0 %><%= link_to @media.category.name, url_for(:controller=>"media",:action=>"category",:id=>@media.category.name) %></p>
  <div class="post_text"><%= find_and_preserve(RedCloth.new(HTMLEntities.decode_entities(@media.text)).to_html) %></div>
  <p class="post_details"><%= link_to _("comments"), url_for(:controller=>@media.permalink+"/#comments") %>:<%= @media.comments.find_all_by_published(1).size %>&nbsp;<%= link_to _("Add comment"),:controller=>"comment",:action=>"new",:id=>@media.id %>&nbsp;<%= link_to _("permalink"), url_for(:controller=>@media.permalink) %>
  &nbsp;<%= "tags:"+@media.tags.collect{|t| link_to(t.name,url_for(:controller=>"media",:action=>"tag",:id=>t.name))}.join(" ") unless @media.tags.count==0 %></p>
</div>
